package cn.ms.neural.moduler.extension.flowrate;

import cn.ms.neural.Adaptor;
import cn.ms.neural.moduler.extension.flowrate.conf.FlowRateConf;
import cn.ms.neural.moduler.extension.flowrate.support.IFlowRateProcessor;

/**
 * 流量控制
 * 
 * @author lry
 */
public interface IFlowRate<REQ, RES> extends Adaptor {

	/**
	 * 流量控制器
	 * <br>
	 * 第一步:并发流控<br>
	 * 第二步:QPS流控<br>
	 * @param flowrateConf
	 * @param flowrateREQ
	 * @param flowrateHandler
	 * @return
	 * @throws Throwable
	 */
	RES flowrate(FlowRateConf flowrateConf, REQ flowrateREQ, IFlowRateProcessor<REQ, RES> flowrateHandler) throws Throwable;
	
}